package com.aspose.cells;

class zbig extends zck {
   zbig(zn var1, float var2, float var3, zbkr var4) {
      super(var1, var2, var3, var4);
   }

   com.aspose.cells.b.a.b.a.ze a(com.aspose.cells.b.a.b.zq var1) {
      com.aspose.cells.b.a.b.a.ze var2 = new com.aspose.cells.b.a.b.a.ze();
      float var3 = 0.0F;
      if (this.e.m != null) {
         if (this.e.m.a.size() > 0) {
            var3 = Math.min(var1.h(), var1.i()) * com.aspose.cells.b.a.ze.a(this.e.m.a.get(0)) / 100000.0F;
         } else {
            var3 = Math.min(var1.h(), var1.i()) * 0.16F;
         }
      } else {
         var3 = Math.min(var1.h(), var1.i()) * 0.16F;
      }

      if (var3 <= 0.0F) {
         var2.b(var1);
         var2.i();
         return var2;
      } else {
         com.aspose.cells.b.a.b.zo[] var4 = new com.aspose.cells.b.a.b.zo[5];
         switch(this.e.b) {
         case 1:
            var4[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var4[1] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.g());
            var4[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var3 + var1.g());
            var4[3] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
            var4[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
            break;
         case 2:
            var4[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var4[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
            var4[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m() - var3);
            var4[3] = new com.aspose.cells.b.a.b.zo(var1.l() - var3, var1.m());
            var4[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
            break;
         case 3:
            var4[0] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
            var4[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
            var4[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
            var4[3] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.m());
            var4[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m() - var3);
            break;
         case 4:
            var4[0] = new com.aspose.cells.b.a.b.zo(var3 + var1.f(), var1.g());
            var4[1] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.g());
            var4[2] = new com.aspose.cells.b.a.b.zo(var1.l(), var1.m());
            var4[3] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.m());
            var4[4] = new com.aspose.cells.b.a.b.zo(var1.f(), var3 + var1.g());
         }

         var2.a(var4[0], var4[1]);
         var2.a(var4[1], var4[2]);
         var2.a(var4[2], var4[3]);
         var2.a(var4[3], var4[4]);
         var2.a(var4[4], var4[0]);
         var2.i();
         return var2;
      }
   }

   void a() {
      com.aspose.cells.b.a.b.zq var1 = this.d(this.e.v());
      super.c(var1);
   }

   private com.aspose.cells.b.a.b.zq d(com.aspose.cells.b.a.b.zq var1) {
      float var2 = 0.0F;
      if (this.e.m != null) {
         if (this.e.m.a.size() > 0) {
            var2 = Math.min(var1.h(), var1.i()) * com.aspose.cells.b.a.ze.a(this.e.m.a.get(0)) / 100000.0F;
         } else {
            var2 = Math.min(var1.h(), var1.i()) * 0.16F;
         }
      } else {
         var2 = Math.min(var1.h(), var1.i()) * 0.16F;
      }

      if (var2 <= 0.0F) {
         return var1;
      } else {
         com.aspose.cells.b.a.b.zq var3 = new com.aspose.cells.b.a.b.zq(var1.f(), var1.g(), var1.h(), var1.i());
         float var4 = var2 / 2.0F;
         float var5 = 0.0F;
         float var6 = 0.0F;
         float var7 = 0.0F;
         float var8 = 0.0F;
         switch(this.e.b) {
         case 1:
            var6 = var4;
            var7 = var4;
            break;
         case 2:
            var7 = var4;
            var8 = var4;
            break;
         case 3:
            var5 = var4;
            var8 = var4;
            break;
         case 4:
            var5 = var4;
            var6 = var4;
         }

         var3.a(var3.f() + var5);
         var3.c(var3.h() - var5);
         var3.c(var3.h() - var7);
         var3.b(var3.g() + var6);
         var3.d(var3.i() - var6);
         var3.d(var3.i() - var8);
         return var3;
      }
   }
}
